package com.green.aop.controller;

import com.green.aop.service.IUserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    private final IUserService userService;

    public UserController(IUserService userService) {
        this.userService = userService;
    }


    @RequestMapping("/add")
    public String addUser() {
        userService.addUser();
        return "添加成功";
    }

    @RequestMapping("/update")
    public String updateUser() {
        userService.updateUser();
        return "修改成功";
    }


    @RequestMapping("/delete")
    public String deleteUser() {
        userService.deleteUser();
        return "修改成功";
    }

    @RequestMapping("/searchUser")
    public String searchUser() {
        userService.serchUser();
        return "查询成功";
    }
}
